'use strict';

module.exports = appInfo => {
  const config = {
    keys: appInfo.name + '_1493345979368_758',
    mongoose: {
      url: 'mongodb://localhost:27017/elephant',
      options: {}
    },
    rest: {
      urlprefix: '/api/v1', // Prefix of rest api url. Defaluts to /api/
      authRequest: null,
      // authRequest: function* (ctx) {
      //   // A truthy value must be returned when authentication succeeds.
      //   // Otherwise the client will be responded with `401 Unauthorized`
      //   return accessToken;
      // }

      // Specify the APIs for which authentication can be ignored.
      // If authRequest is configured, authentication for all APIs is required by default.
      authIgnores: null,
      // authIgnores: {
      //   users: {
      //     show: true, // allow GET /api/users/:id to ignore authentication
      //     index: true,
      //   }
      // }
    },
    security: {
      csrf: {
        ignore: '/api/v1',
      },
    },
  };

  return config;
};
